﻿#ifndef WATER_TIMER_EVENT_H
#define WATER_TIMER_EVENT_H

#include "typedef.h"
#include "misc/timer.h"
#include <vector>
#include "uart/ProtocolCustom.h"

#define START_TIME_POINT             0
#define ALL_BASH1_TIME_POINT             (START_TIME_POINT + 120)
#define ALL_BASH2_TIME_POINT             (ALL_BASH1_TIME_POINT + 120)
#define ALL_BASH3_TIME_POINT             (ALL_BASH2_TIME_POINT + 120)
#define ALL_BASH4_TIME_POINT             (ALL_BASH3_TIME_POINT + 120)

#define ICE_ADD_WATER_TIME_POINT        (START_TIME_POINT + 600)

#define TIME_POINT_1 (1)
#define TIME_POINT_2 (2)
#define TIME_POINT_4 (4)
#define TIME_POINT_6 (6)
#define TIME_POINT_10 (10)
#define TIME_POINT_12 (12)
#define TIME_POINT_25 (25)
#define TIME_POINT_30 (30)
#define TIME_POINT_35 (35)
#define TIME_POINT_40 (40)
#define TIME_POINT_60 (60)
#define TIME_POINT_300 (300)	//冰水箱补水 五分钟
#define TIME_POINT_540 (540)
#define TIME_POINT_600 (600)	//十分钟
#define TIME_POINT_840 (840)
#define TIME_POINT_900 (900)	//十五分钟
#define TIME_POINT_1140 (1140)
#define TIME_POINT_1200 (1200)	//二十分钟

#define MAKE_WATER_TIMEOUT_TIME_POINT        (START_TIME_POINT + 1800)

#define FILTER_BRASH_TIME_POINT        (START_TIME_POINT + 30)

#define DRAIN_WATER_LONG_TIME_POINT        (START_TIME_POINT + 120)

#define DRAIN_WATER_SHORT_TIME_POINT        (START_TIME_POINT + 600)

#define ZERO_STATE_WATER_A1_TIME_POINT        (START_TIME_POINT + 600)
//#define ZERO_STATE_WATER_A1_TIME_POINT        (START_TIME_POINT + 5)
#define ZERO_STATE_WATER_A2_TIME_POINT        (ZERO_STATE_WATER_A1_TIME_POINT + 90)
#define ZERO_STATE_WATER_A3_TIME_POINT        (ZERO_STATE_WATER_A2_TIME_POINT + 10)
#define ZERO_STATE_WATER_A4_TIME_POINT        (ZERO_STATE_WATER_A3_TIME_POINT + 30)

#define ZERO_STATE_WATER_B1_TIME_POINT        (START_TIME_POINT + 28800)
//#define ZERO_STATE_WATER_B1_TIME_POINT        (START_TIME_POINT + 1)
#define ZERO_STATE_WATER_B2_TIME_POINT        (ZERO_STATE_WATER_B1_TIME_POINT + 90)
#define ZERO_STATE_WATER_B3_TIME_POINT        (ZERO_STATE_WATER_B2_TIME_POINT + 10)
#define ZERO_STATE_WATER_B4_TIME_POINT        (ZERO_STATE_WATER_B3_TIME_POINT + 30)



#define WATER_CHECK_PRESS_TEST_TIME_POINT        (START_TIME_POINT + 360)

#define LED_OFF_TIME_POINT						(START_TIME_POINT + 60)

#define PREVENT_DRY_BURNING_TIME_POINT			(START_TIME_POINT + 5)

#define HOT_WATER_DELAY_TIME_POINT			(START_TIME_POINT + 2)


namespace water {

void start_timer_event(ETimerEventId id,int second = 0);
void stop_timer_event(ETimerEventId id,bool on = true);
void reset_timer_event(ETimerEventId id);
bool is_timer_event_running(ETimerEventId id);
void stop_all_timer_event();

//用于注册定时器事件(ui用)
void add_timer_event_ui(timer_cb cb);
void remove_timer_event_ui(timer_cb cb);

bool is_higher_priority(ETaskId task_id);
bool set_task_load(ETaskId task_id, bool is_on, std::vector<E_DEV_LOAD_TYPE> load_types, bool is_stop = true);
bool is_task_running(ETaskId task_id);

}


#endif // WATER_TIMER_EVENT_H
